﻿using Microsoft.EntityFrameworkCore.Migrations;

namespace EFEntity.Migrations
{
    public partial class mim1 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "config_file_first_kind",
                columns: table => new
                {
                    ffk_id = table.Column<int>(nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    first_kind_id = table.Column<string>(maxLength: 2, nullable: true),
                    first_kind_name = table.Column<string>(maxLength: 20, nullable: true),
                    first_kind_salary_id = table.Column<string>(maxLength: 20, nullable: true),
                    first_kind_sale_id = table.Column<string>(maxLength: 20, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_config_file_first_kind", x => x.ffk_id);
                });

            migrationBuilder.CreateTable(
                name: "config_file_second_kind",
                columns: table => new
                {
                    fsk_id = table.Column<int>(nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    first_kind_id = table.Column<string>(maxLength: 2, nullable: true),
                    first_kind_name = table.Column<string>(maxLength: 20, nullable: true),
                    second_kind_id = table.Column<string>(maxLength: 2, nullable: true),
                    second_kind_name = table.Column<string>(maxLength: 20, nullable: true),
                    second_salary_id = table.Column<string>(maxLength: 20, nullable: true),
                    second_sale_id = table.Column<string>(maxLength: 20, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_config_file_second_kind", x => x.fsk_id);
                });

            migrationBuilder.CreateTable(
                name: "config_file_third_kind",
                columns: table => new
                {
                    ftk_id = table.Column<int>(nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    first_kind_id = table.Column<string>(maxLength: 2, nullable: true),
                    first_kind_name = table.Column<string>(maxLength: 20, nullable: true),
                    second_kind_id = table.Column<string>(maxLength: 2, nullable: true),
                    second_kind_name = table.Column<string>(maxLength: 20, nullable: true),
                    third_kind_id = table.Column<string>(maxLength: 2, nullable: true),
                    third_kind_name = table.Column<string>(maxLength: 20, nullable: true),
                    third_kind_sale_id = table.Column<string>(maxLength: 20, nullable: true),
                    third_kind_is_retail = table.Column<string>(maxLength: 20, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_config_file_third_kind", x => x.ftk_id);
                });

            migrationBuilder.CreateTable(
                name: "config_major",
                columns: table => new
                {
                    mak_id = table.Column<int>(nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    major_kind_id = table.Column<string>(maxLength: 2, nullable: true),
                    major_kind_name = table.Column<string>(maxLength: 60, nullable: true),
                    major_id = table.Column<string>(maxLength: 2, nullable: true),
                    major_name = table.Column<string>(maxLength: 60, nullable: true),
                    test_amount = table.Column<int>(nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_config_major", x => x.mak_id);
                });

            migrationBuilder.CreateTable(
                name: "config_major_kind",
                columns: table => new
                {
                    mfk_id = table.Column<int>(nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    major_kind_id = table.Column<string>(maxLength: 2, nullable: true),
                    major_kind_name = table.Column<string>(maxLength: 60, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_config_major_kind", x => x.mfk_id);
                });

            migrationBuilder.CreateTable(
                name: "config_public_char",
                columns: table => new
                {
                    pbc_id = table.Column<int>(nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    attribute_kind = table.Column<string>(maxLength: 60, nullable: true),
                    attribute_name = table.Column<string>(maxLength: 60, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_config_public_char", x => x.pbc_id);
                });

            migrationBuilder.CreateTable(
                name: "salary_standard_details",
                columns: table => new
                {
                    sdt_id = table.Column<int>(nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    standard_id = table.Column<string>(maxLength: 30, nullable: true),
                    standard_name = table.Column<string>(maxLength: 60, nullable: true),
                    item_id = table.Column<int>(nullable: false),
                    item_name = table.Column<string>(maxLength: 60, nullable: true),
                    salary = table.Column<decimal>(nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_salary_standard_details", x => x.sdt_id);
                });

            migrationBuilder.CreateTable(
                name: "user",
                columns: table => new
                {
                    user_id = table.Column<int>(nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    user_name = table.Column<string>(nullable: false),
                    user_true_name = table.Column<string>(nullable: false),
                    user_password = table.Column<string>(nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_user", x => x.user_id);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "config_file_first_kind");

            migrationBuilder.DropTable(
                name: "config_file_second_kind");

            migrationBuilder.DropTable(
                name: "config_file_third_kind");

            migrationBuilder.DropTable(
                name: "config_major");

            migrationBuilder.DropTable(
                name: "config_major_kind");

            migrationBuilder.DropTable(
                name: "config_public_char");

            migrationBuilder.DropTable(
                name: "salary_standard_details");

            migrationBuilder.DropTable(
                name: "user");
        }
    }
}
